﻿package
{
	import com.urbansquall.preloader.*;
	import flash.text.TextField;
	
	public class MyPreloader extends Preloader
	{
		private var m_textfield : TextField;
		
		public function MyPreloader()
		{
			
		}
				
		override protected function beginLoading() : void
		{
			m_textfield = new TextField();
			addChild( m_textfield );
			m_textfield.text = "0%";
		}
		
		override protected function updateLoading( a_percent : Number ) : void
		{
			m_textfield.text = Math.round( a_percent * 100 ) + "%";
		}
		
		override protected function endLoading() : void
		{
			removeChild( m_textfield );
			m_textfield = null;
		}
	}
}